package anbow.cllectionmap;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class ListDemo {

	public static void main(String[] args) {
		
		List<Integer> list = new ArrayList<>();
		//Set<Integer> set = new HashSet<>();
		
		List<List<Integer>> list2 = new ArrayList<>();
		
		list.add(1);
		list.add(2);
		list.add(3);
		
		System.out.println(list);
		
		list.add(1, 5);
		
		System.out.println(list);
		
		list.set(1, 10);
		
		System.out.println(list);
		
		System.out.println(list.get(1));
		System.out.println(list.indexOf(10));
		
		for(int i=0;i<list.size();i++) {
			System.out.print(list.get(i) + " ");
		}
		
		System.out.println();
		
		for(int x : list) {
			System.out.print(x + " ");
		}
		
	}

}
